Adding a Lookup

This appendix contains the following topics:

Introduction to Adding a Lookup

Getting to Lookup Access Maintenance

Lookup Access Maintenance

Setting GUI Environment Variable for Char-based Entry

 

Introduction to Adding a Lookup

For any field validated against a PBS data file a Lookup or PopUp window can be added to assist users with viewing, selecting and entering valid data.

Using character mode, Passport Business Solutions Lookup and PopUp windows are “attached” to input fields without modification to application source code. Instead, they are added using the LookUp Access maintenance program while running Passport Business Solutions.

Any input field in Passport Business Solutions can have a Lookup or PopUp window attached, but the window used is dependent on the data that displays and the data that is returned to the field. For example, in most cases it would not make sense to attach a Window that displays and returns item information to the customer number field in Customers (Enter). There is the exception of the various Notes Lookups. The Notes Lookup is used for viewing only and not for returning data back to a field.

       Note 

Lookup Maintenance is the program where a Lookup can be modified. Lookup Access Maintenance is used to assign a Lookup to a field.

Lookup Access Maintenance is described in this appendix. Lookup Maintenance is described in the chapter Lookup Design.

Also, if you have a new data file with a new maintenance screen you may need to add a Lookup(s) to the screen. See your PBS supplier for instructions on where to add the file access, if applicable.

Getting to Lookup Access Maintenance

There is a very specific and somewhat hidden method of getting to Lookup Access Maintenance. Passport Business Solutions can be set up to use either the older character-based PopUp Windows or the newer Lookup Windows. The Lookup Access Maintenance is only available when Passport Business Solutions is set in the configuration file to use the character-based PopUps. There is a special cblconfi.pbsp (Windows) and cblconfig.pbsp (UNIX/Linux) that have been set up to use the PopUps. There is a batch and script that has been installed that will utilize this configuration file.

       Note 

If you prefer you can modify a configuration file to get to Lookup Access Maintenance. The ‘USE_PTOOLS’ flag in the cblconfi (Windows) and cblconfig (UNIX/Linux) files that will have to be set to N. Be sure it set them back to Y when you are finished.

From a command prompt type:

pbsp

Here are the steps on how you get to Lookup Access Maintenance.

Press <F8> to display the character-based style PopUp window. If a help window displays, skip the next step.
Press <F8> to display the standard PBS help window. The PBS help window must always be displayed first in order to access the Lookup Access maintenance window.
Press <F3> followed by <F2> and Lookup Access Maintenance will display. When you press <F3> the message “Change not allowed” will display. This is meant to deter individuals who are not supposed to be modifying these definitions. Pressing <F2> overrides the message.

The PopUp maintenance screen is described in more detail below.

Lookup Access Maintenance

The Lookup Access maintenance window provides a means of attaching and removing PopUp/Lookup windows to Passport Business Solutions ™ input fields. Here is an example of the window.

Display Fields

Notice that the information displayed at the top of the window identifies the input field where the PopUp window is attached.

Unless otherwise indicated, most of the displayed information will not be relevant for entering the Lookup access record.

The displayed portion of the screen contains the following fields.

POPMNT called from

This is the location from which the PopUp maintenance was called.

The first two characters refer to the module. The next 6 to 8 characters refer to the program name.

Next you will see one of two characters, IN or CN. The IN means that it is an input field and CN means that it is from Field number to change.

The next two numbers refer to the row and column where the field is located on the screen. The last number is the field length.

PopUp key type

This indicates the type of key used to locate the attached PopUp window. Two types are possible:

1.SCRN-PARAM - the first 11 characters of the screen parameter will be the key.

2.SCRN-PARAM-ID - the screen parameter ID will be the key.

The SCRN-PARAM-ID as a “3 digit field which allows the data lookup functions to handle multiple definitions of the same field.” For example, select Reports from the CTL menu and then select Cash Accounts from the submenu. The starting and ending account number fields use SCRN-PARAM-ID = 001.

PopUp key

This is the key used to store this PopUp program definition and its pass data and this is stored in the file.

Enterable Fields

1. PopUp program name

This is the name of the PopUp window you want to attach to the field. If the program name is left blank, the PopUp will be removed (detached) from the field.

If there is no PopUp program name for this field and you are going to use a PowerTools driver for this field, then enter PTOOLS as the program.

Format

5 characters

Example

Type: PVENNN

2. PopUp pass data

Enter pass data for the Lookup or PopUp.

This is data that is passed into the PopUp window program. This data will need to be in a specific format depending upon how the PopUp program or PowerTools Lookup program was designed. Pass data is usually needed for filtering. It can also be used for sorting.

Here is a filtering example. In order to filter out only the ship-to’s for one customer, the program needs to know which customer number has been entered. This is done with the RL (Retrieve Literal) string of data. This data includes the field row, column and size. For the ship-to example, the RL data for finding the customer number field is “RL,11,20,12”. The customer number field is located on row 11, column 20 and the field length is 12.

Here is a sorting example. The vendor PopUp window was designed to sort by vendor number or name (text) by setting the pass data to either “N” or “T”. This way, the same PopUp can be used on the vendor number or name field in Vendor Maintenance. The letters “N” and “T” were chosen to standardize so that they could also be used in the customer and item PopUp windows, which were designed with similar functionality.

See Setting GUI Environment Variable for Char-based Entry for more technical means of filtering and sorting.

Format

22 characters

Example

Type: RL,06,17,06

3. Record type

With PBS 12.01, this field is no longer needed.

Normally this will have an entry of ‘P’ for PowerTools Lookup. If you have a custom driver or want to revert back to the older PopUp for the field you are on, then make sure that the field is blank.

Format

1 character

Example

Type: P

4. Lookup driver name

With PBS v12.01 and later versions this field is no longer needed.

Some fields may not have a Popup window but they have a PowerTools Lookup Window. In cases like this, the PowerTools driver name is entered in this field. If you have a driver created by Passport for a custom file not found in Passport Business Solutions, you will have to enter the driver name in this field. An example is in G/L Master information > Budget types, Field 1 Budget type. As you can see the PowerTools driver name is glbudtyp.scr.

Format

12 characters

Example

Type: arcuhfil.scr

5. Lookup pass data

With PBS v12.01 and later versions this field is no longer needed.

Some PowerTools driver Lookups can filter out certain data. In most cases it is used for filtering data or returning certain values. It can also be used for a third RL (Retrieve Literal) number.

There is an example in PR > Employees Field 34. The pass data is S and you can only view the state tax codes. The city and Federal tax codes are filtered out. On field 35 it is using the C which only allows city tax codes.

Format

25 characters

Example

Type: S

Field number to change ?

You have the following options at FNTC.

Enter

Saves the new Lookup access record or saves the changes to the record and exits the window back to the Help window and exits the window back to the Help window.

Esc

Removes the new Lookup access record or removes the changes made to the record and exits the window back to the Help window.

Testing Lookup Access

When you test the access to a character-based PopUp window, return to the input field and press <F8>.

If you are testing a PowerTools Lookup window, you will need to log back into Passport Business Solutions using a configuration file with the following setting ‘USE_PTOOLS = Y.

As an alternate to testing a PowerTools Lookup you can have two concurrences of Passport Business Solutions open at the same time. One will have the USE_PTOOLS set to N and the other set to Y. This will allow you to enter or edit Popup Access Maintenance in one and test it in the other.

Setting GUI Environment Variable for Char-based Entry

This section is intended for source code users.

Limitations of POPFIL records and LNK-LKUP-KEY-FLD-LOC

While GUIizing lookup (PU\Source\*.PU) programs, starting with 12.01 PBS has enhanced them to add sorting, filtering and at times returning different values.

In the past, lookup displays were modified mostly by the data passed in the LNK-LKUP-KEY-FLD-LOC field, part the POPFIL record. Unfortunately, this field is limited by its size, 22 bytes. This allows us to retrieve up to 2 values from the screen.

With GUIizing, we ran into situations where more information is needed by the lookup program to correctly sort, filter and know what to return to a program that is running in the Classical mode (aka character-based mode). In such cases, we may have the caller load the PASS-??????-FLDS (where ?????? stands for the name of the lookup being called) or a new field into the environment and have the lookup program accept it in its MAIN-LOGIC.